package com.lesso.lzh.sunflower.app.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.lesso.lzh.sunflower.domain.service.RelEmployeeDeviceDomainService;
import com.lesso.lzh.sunflower.infra.assembler.RelEmployeeDeviceAssembler;
import com.lesso.lzh.sunflower.model.RelEmployeeDevice;
import com.lesso.lzh.sunflower.pojo.dto.RelEmployeeDeviceDTO;
import com.lesso.lzh.sunflower.pojo.dto.RelEmployeeDeviceQueryDTO;
import com.lesso.lzh.sunflower.pojo.vo.RelEmployeeDeviceVO;
import com.lesso.lzh.sunflower.service.IRelEmployeeDeviceService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * RelEmployeeDeviceServiceImpl
 *
 * @author zqz
 * @since 2025-07-05
 */
@Service
@DubboService
public class RelEmployeeDeviceServiceImpl implements IRelEmployeeDeviceService {
    private final RelEmployeeDeviceDomainService relEmployeeDeviceDomainService;

    public RelEmployeeDeviceServiceImpl(RelEmployeeDeviceDomainService relEmployeeDeviceDomainService) {
        this.relEmployeeDeviceDomainService = relEmployeeDeviceDomainService;
    }

    @Override
    public Long save(RelEmployeeDeviceDTO dto) {
        return relEmployeeDeviceDomainService.save(dto);
    }

    @Override
    public Page<RelEmployeeDeviceVO> page(RelEmployeeDeviceQueryDTO dto) {
        return relEmployeeDeviceDomainService.page(dto);
    }

    @Override
    public Page<RelEmployeeDeviceVO> customPage(RelEmployeeDeviceQueryDTO dto) {
        return relEmployeeDeviceDomainService.customPage(dto);
    }

    @Override
    public void deleteById(Long id) {
        relEmployeeDeviceDomainService.deleteById(id);
    }

    @Override
    public RelEmployeeDevice selectById(Long id) {
        return relEmployeeDeviceDomainService.selectById(id);
    }

    @Override
    public void update(RelEmployeeDeviceDTO dto) {
        RelEmployeeDevice relEmployeeDevice = RelEmployeeDeviceAssembler.INSTANCE.dtoToEntity(dto);
        relEmployeeDeviceDomainService.update(relEmployeeDevice);
    }

    @Override
    public List<RelEmployeeDeviceVO> listByEmployeeId(Long employeeId) {
        return relEmployeeDeviceDomainService.listByEmployeeId(employeeId);
    }
}